package com.ruoyi.shop.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.shop.mapper.ShopPickupStationMapper;
import com.ruoyi.shop.domain.ShopPickupStation;
import com.ruoyi.shop.service.IShopPickupStationService;
import com.ruoyi.common.core.text.Convert;

/**
 * 自提点Service业务层处理
 * 
 * @author Alan Zhang
 * @date 2021-10-14
 */
@Service
public class ShopPickupStationServiceImpl implements IShopPickupStationService 
{
    @Autowired
    private ShopPickupStationMapper shopPickupStationMapper;

    /**
     * 查询自提点
     * 
     * @param stationId 自提点主键
     * @return 自提点
     */
    @Override
    public ShopPickupStation selectShopPickupStationByStationId(Long stationId)
    {
        return shopPickupStationMapper.selectShopPickupStationByStationId(stationId);
    }

    /**
     * 查询自提点列表
     * 
     * @param shopPickupStation 自提点
     * @return 自提点
     */
    @Override
    public List<ShopPickupStation> selectShopPickupStationList(ShopPickupStation shopPickupStation)
    {
        return shopPickupStationMapper.selectShopPickupStationList(shopPickupStation);
    }

    /**
     * 新增自提点
     * 
     * @param shopPickupStation 自提点
     * @return 结果
     */
    @Override
    public int insertShopPickupStation(ShopPickupStation shopPickupStation)
    {
        shopPickupStation.setCreateTime(DateUtils.getNowDate());
        return shopPickupStationMapper.insertShopPickupStation(shopPickupStation);
    }

    /**
     * 修改自提点
     * 
     * @param shopPickupStation 自提点
     * @return 结果
     */
    @Override
    public int updateShopPickupStation(ShopPickupStation shopPickupStation)
    {
        shopPickupStation.setUpdateTime(DateUtils.getNowDate());
        return shopPickupStationMapper.updateShopPickupStation(shopPickupStation);
    }

    /**
     * 批量删除自提点
     * 
     * @param stationIds 需要删除的自提点主键
     * @return 结果
     */
    @Override
    public int deleteShopPickupStationByStationIds(String stationIds)
    {
        return shopPickupStationMapper.deleteShopPickupStationByStationIds(Convert.toStrArray(stationIds));
    }

    /**
     * 删除自提点信息
     * 
     * @param stationId 自提点主键
     * @return 结果
     */
    @Override
    public int deleteShopPickupStationByStationId(Long stationId)
    {
        return shopPickupStationMapper.deleteShopPickupStationByStationId(stationId);
    }
}
